package com.rentplant.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.rentalcollect;
import com.rentplant.Pojo.rentalcollectanduser;
import com.rentplant.mapper.rentalCollectMapper;
import com.rentplant.service.rentalCollectService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class rentalCollectServiceImp implements rentalCollectService {

    @Autowired
    private rentalCollectMapper rentalcollectmapper;

    //查询该租房信息是否收藏
    @Override
    public List<rentalcollect> rentalCollectById(JSONObject rentalinfo){
        return rentalcollectmapper.rentalCollectById(rentalinfo);
    }

    //取消租房信息收藏
    @Override
    public boolean delRentalCollect(JSONObject rentalinfo){
        return rentalcollectmapper.delRentalCollect(rentalinfo);
    }

    //收藏物品
    @Override
    public boolean addRentalCollect(JSONObject rentalinfo){
        return rentalcollectmapper.addRentalCollect(rentalinfo);
    }

    //    展示用户收藏的租房信息
    @Override
    public List<rentalcollectanduser> showRentalCollect(JSONObject userinfo){
        return rentalcollectmapper.showRentalCollect(userinfo);
    }
}
